package day03;
import java.util.Scanner;
public class Task02 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //1.CommandBySwitch命令解析程序：
        int age = scan.nextInt();
        switch (age) {
            case 0:
                System.out.println("未满一周岁，游玩设备时请注意宝宝安全");
            case 1:
                System.out.println("1岁");
                break;
            case 2:
                System.out.println("2岁");
                break;
            case 3:
                System.out.println("3岁");
                break;
            default:
                System.out.println("超出优惠年龄，请购买全票");
        }

        //2.猜数字之while版
        int workYears = (int) (Math.random() * 50 + 1);
        System.out.println("猜猜我上班多少年了");
        int years = scan.nextInt();
        while (years != workYears) {
            if (years > workYears) {
                System.out.println("没那么久");
            } else {
                System.out.println("猜少了");
            }
            years = scan.nextInt();
        }
        System.out.println("猜对了！");

        //3.猜数字之do...while版
        System.out.println("猜猜我期末考了多少分！");
        int finalScore = (int) (Math.random() * 100) + 1;
        int score = scan.nextInt();
        System.out.println("没听清再说一次");
        do {
            score = scan.nextInt();
            if (score > finalScore) {
                System.out.println("高了");
            } else {
                System.out.println("低了");
            }
        } while (score != finalScore);
        System.out.println("这都被你猜到了！");

        //4.for循环：输出5次"行动是成功的阶梯"、输出9的乘法表(1到9、1/3/5/7/9、9到1)
        for (int number = 1; number < 6; number++) {
            System.out.println("行动是成功的阶梯");

            for(int a_1 =1;a_1<9;a_1++)   {
                System.out.println(a_1+"*9="+a_1*9);
            }

            for (int aa1 =1;aa1<9;aa1=aa1+2){
                System.out.println(aa1+"*9="+aa1*9);
            }

            for(int a$1 =9;a$1>0;a$1-=1){
                System.out.println(a$1+"*9="+a$1*9);
            }


        }
    }


    }
